<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<div class=" w-100p mini-top-bar">
    <div class="w-1200 margin-0-auto">
        <ul class="nav-left fl">
            <li class="home"><a href="${ctx }">欧工首页</a></li>
            <c:choose>
	        	<c:when test="${currentUser == null}">
	        		<li class="login"><a href="${ctx}/user/login">登录</a></li>
            		<li class="register"><a href="${ctx }/user/register">注册</a></li>
	        	</c:when>
	        	<c:otherwise>
	        		<li class="login"><a>欢迎您,${currentUser.realName }!<span style="color:blue;" onclick="javascript:location.href='j_spring_security_logout'">【退出登录】</span></a></li>
	        	</c:otherwise>
        	</c:choose>
        </ul>
        <ul class="nav-right fr">
            <li class="order"><a href="${ctx }/admin/index?target=/order/myOrder">我的订单</a></li>
            <li class="account"><a href="${ctx }/admin/index">个人中心</a></li>
            <li class="downapp"><a href="#" class="topcode">下载APP
            <div><img src="${ctx }/img/code_app.png"/></div>
            </a>
            </li>
        </ul>
    </div>
    
</div>
<!--logo 和tags-->
<div class="w-1200 sub-nav margin-0-auto">
    <a class="logo" href="#"><img src="${ctx }/img/logo.png"></a>
     <div class="searchbar-warp-min" style="float:left">
         <div class="searchbar">
             <form>
                 <span class="icon-serach"></span>
                 <input class="serach-input" type="text" value="${search }" placeholder="请输入关键字">
                 <button class="serach-btn" type="button" onclick="forSearch(this);" id="btn-search">搜索</button>
                 <script>
                 $('.serach-input').on('keydown', function() {
                	 if (event.keyCode == 13) {
                		 $('#btn-search').trigger('click');
                		 return false;
                		 }
                });
                var json = {};
					window.onload=getCartCount;
					
				function getCartCount() {   //刷新购物车
					$.ajax({
						url: "${ctx}/cart/cartCountOfUser",
						data:json,
						dataType: "json",
						type: "get",
						success: function(data) {
							if (data.success) {
								//loading带文字
								var cartCount = data.count;
								$('#cartCount').html(cartCount);
							} else {
								layer.alert(data.msg,{icon:2,skin: 'layer-ext-moon'});
							}
						}
					});
				}
				
				
                 </script>
             </form>
         </div>
         <ul class="key-words margin-0-auto">
             <li>沙发</li>
             <li class="splider"></li>
             <li>床垫</li>
             <li class="splider"></li>
             <li>电视机</li>
             <li class="splider"></li>
             <li>茶几</li>
             <li class="splider"></li>
             <li>书桌</li>
             <li class="splider"></li>
             <li>床</li>
             <li class="splider"></li>
             <li>地毯</li>
             <li class="splider"></li>
             <li>电脑桌</li>
         </ul>     </div>
         <a href="${ctx }/cart/cartList" class="go-shopcart" target="_blank">购物车(<span class="text-red" id="cartCount">0</span>)</a> 
</div>
<!--导航-->
<div class="menu-warp  w-100p ">
    <div class="menu w-1200 margin-0-auto">
        
        <!-- 类目 -->
        <%@include file="index_category.jsp" %>
        
        <ul class="menu-list">
            <li><a class="active" href="${ctx}/index">首页</a></li>
            <li><a href="${ctx}/designer/index">找设计师</a></li>
            <li><a href="${ctx}/design/indexNew">找方案</a></li>
            <li><a href="http://rzds.admin.3vjia.com/Login.aspx?ogSessionId=${ogSessionId }">3D软装大师</a></li>
            <li><a href="${ctx}/staybag/index">拎包入住</a></li>
            <li><a href="${ctx}/crazy/index">疯狂软装学院</a></li>
            <!--  
            <li><a class="active" href="${ctx }">首页</a></li>
            <li><a href="${ctx }/design/index">样板方案</a></li>
            <li><a href="http://rzds.admin.3vjia.com/Login.aspx" target="_blank">3D软装大师</a></li>
            <li><a href="${ctx }/hardcover/index" target="_blank">拎包入住</a></li>
            -->
           
           
        </ul>
    </div>
</div>